<template>
  <div
    style="
      background-color: #fff;
      height: 100px;
      margin-top: -20px;
      width: 100%;
      text-align: center;
    "
  >
    <span style="font-size: 30px; font-weight: 600">《库存清单》</span>
  </div>
  <div
    style="background-color: #fff; height: 500px; margin-top: 20px; width: 100%"
  >
    <span style="margin: 20px">报表条件</span>
    <hr style="margin-top: 20px; background: #ddd" />
    <el-form-item
      label=""
      style="float: left; margin: 20px 20px 20px 360px; width: 300px"
    >
      物料
      <el-select placeholder="请选择">
        <el-option label="请选择" :value="0" />
        <el-option
          v-for="item1 in loadshowSelect1"
          :key="item1.inventoryInfoId"
          :label="item1.itemName"
          :value="item1.inventoryInfoId"
        />
      </el-select>
    </el-form-item>
    <el-form-item
      label=""
      style="float: right; margin: 20px 360px 20px 20px; width: 300px"
    >
      仓库
      <el-select placeholder="请选择">
        <el-option label="请选择" :value="0" />
        <el-option v-for="item2 in loadshowSelect2" :key="item2.warehouseId" :label="item2.warehouseName" :value="item2.warehouseId" />
      </el-select>
      <el-button :icon="Edit" type="primary" style="margin-left: 190px;margin-top: 50px;">查看报表</el-button>
    </el-form-item>
    <iframe :src= "fr_cpt_url" width="100%" height="400" frameborder="0" scrolling="auto"
          >
        </iframe>
  </div>
</template>

<script setup lang="ts">
import axios from "axios";
import { ref, onMounted } from "vue";
import { Edit } from "@element-plus/icons-vue";
const apiurl = import.meta.env.VITE_APP_API_URL_ProductionShow;

//页面初始化数据
const loadshowSelect1: any = ref([]);
const loadshowSelect2: any = ref([]);
const LoadShowData = () => {
  const data = {};
  axios.post(apiurl + "/api/W/ItemInfoShow", data).then((res1: any) => {
    console.log(res1.data);
    loadshowSelect1.value = res1.data.data;
  });
  axios.post(apiurl + "/api/W/WarehouseSelect", data).then((res2: any) => {
    console.log(res2.data);
    loadshowSelect2.value = res2.data.data;
  });
};
const fr_cpt_url=ref("http://localhost:8075/webroot/decision/view/report?viewlet=WorkBook3.cpt")
//生命周期钩子函数
onMounted(() => {
  LoadShowData();
});
</script>

<style scoped></style>
